#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <vector>
#include "Vector.h"

using std::cout;
using std::endl;

void test1()
{
	std::vector<int> v;
	
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);

	for (auto e : v) cout << e << " ";
	cout << endl;

	v.erase(v.begin(), v.begin() + 2);

	for (auto e : v) cout << e << " ";
	cout << endl;
}

void test2()
{
	myvector::vector<int> v1;
	myvector::vector<char> v2(10, 'a');
	for (int i = 0; i < 10; i++)
	{
		v2[i] = 'a' + i;
		cout << v2[i] << " ";
	}
	cout << endl;
	v2.reserve(12);
	//v2.resize(8);
	cout << v2.size() << " " << v2.capacity() << endl;
	
	const myvector::vector<char> v3(v2);
	for (int i = 0; i < 10; i++)
	{
		//v3[i] = 'a' + i;
		cout << v3[i] << " ";
	}
	cout << endl;

	myvector::vector<char> v4;
	v4 = v2;
	v4[5] = 'a';
	v4.print();

	v4.push_back('a');
	v4.push_back('a');
	v4.push_back('a');
	v4.push_back('a');
	v4.push_back('a');
	v4.print();	

	v4.erase(v4.begin() + 12);
	v4.erase(v4.begin());
	v4.print();
}

int main()
{
	//test1();
	test2();
	return 0;
}